<%@page import="org.springside.modules.security.springsecurity.SpringSecurityUtils"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/pages/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
<script type="text/javascript" src="../js/js.js"></script>
<style type="text/css">
 input{
  width:57;
  height:20;
 }
</style>
<script type="text/javascript">

		function onImageClick(o){
		    o.src = "${ctx}/security/jcaptcha.jpg?"+ new Date();
		}
		function CheckPost(){

	if(myform.j_username.value=="")
	{
		alert("请填写用户名");
		myform.j_username.focus();
		return false;
	}
	if(myform.j_password.value=="")
	{
		alert("请填写密码");
		myform.j_password.focus();
		return false;
	}
	
	if(myform.j_captcha.value=="")
	{
		alert("请填写验证码");
		myform.j_captcha.focus();
		return false;
	}
	}
	
			if (location.href.indexOf("error=1") != -1) {
				         alert("用户名或密码错误！"); 
				          window.location.href="${ctx}/admin"; 
				           
				}
				if (location.href.indexOf("error=2")!=-1) {
				         alert("验证码输入错误！");  
				          window.location.href="${ctx}/admin";  
				          
				} 
			
	</script>
<% if(SpringSecurityUtils.getCurrentUserName().equals("anonymousUser")) {%>
<center>
<div id="top"> </div>
<form id="loginform" method="post" name="myform" action="j_spring_security_check" onsubmit="CheckPost();">
  <div id="center">
  
    <div id="center_left"></div>
    <div id="center_middle">
    <table style="font-size:12px;">
    	<tr>
    		<td>用户名：</td>
    		<td><input type="text" id='j_username' name='j_username' /></td>
    	</tr>
    	<tr>
    		<td>密　码：</td>
    		<td><input type="password" id='j_password' name='j_password' /></td>
    	</tr>
    	<tr>
    		<td>验证码：</td>
    		<td><input name="j_captcha" type="text" name="j_captcha"  class="chknumber_input" /></td>
    		<td><img src="${ctx }/security/jcaptcha.jpg" title="换一换" onclick="onImageClick(this);" id="safecode" width="55" height="20"/></td>
    	</tr>
    </table>
    </div>
    <div id="center_middle_right"></div>
    <div id="center_submit">
      <div class="button"><input type="image" src="../images/dl.gif"></div>
      <div class="button"> <img src="../images/cz.gif" width="57" height="20" onclick="javascript:document.forms['myform'].reset(); return false;"> </div>
    </div>
    <div id="center_right"></div>
    
  </div>
</form>
<div id="footer"></div>
</center>
<%} %>
<html>
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广东工业大学招生办后台管理</title>
  </head>
  
<frameset rows="127,*,11" frameborder="no" border="0" framespacing="0">
	<frame src="top.jsp" name="topFrame" scrolling="No"
		noresize="noresize" id="topFrame" />
	<frame src="center.jsp" name="mainFrame" id="mainFrame" />
	<frame src="down.jsp" name="bottomFrame" scrolling="No"
		noresize="noresize" id="bottomFrame" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
